<template>
  <view class="content">
    <template v-if="msgList.length > 0">
      <view class="item" @click="goDetails(item)" v-for="item in msgList" :key="item.messageId">{{ item.bullyingType }}-{{ item.severityEvaluation }}</view>
    </template>
  </view>
</template>

<script setup>
import { ref } from "vue";
import { reportList } from "@/api";
import { onShow } from "@dcloudio/uni-app";

const msgList = ref([]);

const getMsg = () => {
  reportList().then((res) => {
    msgList.value = res;
  });
};

const goDetails = (row) => {
  let url = `/pages/result/index?id=${row.id || 3}`;
  uni.navigateTo({
    url,
  });
};

onShow(() => {
  getMsg();
});
</script>

<style lang="scss">
.content {
  min-height: 100vh;
  .item {
    height: 80rpx;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 40rpx;
    border-bottom: 1px solid #dedede;
    font-size: 28rpx;
    color: #000;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .btn {
    margin: 40rpx;
    height: 80rpx;
    background: #000;
    color: #fff;
    font-size: 28rpx;
    line-height: 80rpx;
  }
}
</style>
